Conversation
Arech8
left a comment
There was a problem hiding this comment.
if clang path is fine, then fine.
f29ad94 to
c5e7814
Compare
c5e7814 to
c124e70
Compare
c124e70 to
cee3af4
Compare
|
Hi @i-chaochen is this only a documentation change? What should we focus on in our review? |
cee3af4 to
e1c609f
Compare
| Once inside the container, | ||
| ```shell | ||
| python3 stack.py develop --rebuild-makefile | ||
| ``` |
There was a problem hiding this comment.
Everything looks good but a question: Should we add a link referencing the Local build.py Build here? @charleshofer
|
This commit broken capability to build jaxlib using jax/build/build.py |
| ## 1. Build & Install Plugin Wheels | ||
|
|
||
| ```shell | ||
| # Set your GFX targets to whatever you've got installed | ||
| AMDGPU_TARGETS="$(shell rocminfo | grep -o -m 1 'gfx.*')" | ||
|
|
||
| # Clone rocm-jax and run build.py | ||
| git clone git@github.com:ROCm/rocm-jax.git | ||
| cd jax_rocm_plugin | ||
| python3 build/build.py build | ||
| --use_clang=true \ | ||
| --clang_path=/lib/llvm-18/bin/clang-18 \ | ||
| --wheels=jax-rocm-plugin,jax-rocm-pjrt \ | ||
| --target_cpu_features=native \ | ||
| --rocm_path=/opt/rocm \ | ||
| --rocm_version=7 \ | ||
| --rocm_amdgpu_targets=${AMDGPU_TARGETS} \ | ||
| --verbose | ||
| pip3 install dist/jax_rocm* --force-reinstall | ||
| ``` | ||
|
|
||
| By default, this builds against specific commits of `jax-ml/jax` and | ||
| `rocm/xla` that are kept in `jax_rocm_plugin/third_party/xla/workspace.bzl` and | ||
| `jax_rocm_plugin/third_party/jax/workspace.bzl`. You can override this and | ||
| build with your local JAX and XLA by adding, | ||
|
|
||
| ```shell | ||
| --bazel_options=--override_repository=xla=<path to my XLA> | ||
| --bazel_options=--override_repository=jax=<path to my JAX> | ||
| ``` | ||
|
|
||
| ## 2. Build & Install `jaxlib` | ||
|
|
||
| ```shell | ||
| git clone git@github.com:ROCm/jax.git | ||
| cd jax | ||
| python3.11 ./build/build.py build \ | ||
| --target_cpu_features=native \ | ||
| --use_clang=true \ | ||
| --clang_path=/lib/llvm-18/bin/clang-18 \ | ||
| --wheels=jaxlib \ | ||
| --verbose | ||
| pip install dist/jaxlib* --force-reinstall | ||
| ``` |
There was a problem hiding this comment.
Could you please also include a subsection of how to build these libraries with debug symbols in them. The team that I'm on likes to often rebuild these libraries from source with debug symbols for our work.
Thank you!
There was a problem hiding this comment.
jax_rocm_plugin/build/build.py needs to support build local jaxlib too (just uses jax at rocm_jax/jax), so that it will be consistent with jax_rocm plugin. Also do not add .dev.xxxxxx to name/version of jaxlib wheel. I believe that jax_rocm_plugin/build/build.py has such function previous.
Hi @jiagaoxiang thanks for review. Yes, if you have any questions/unclear about your current jax/xla build and use scearnios, yes, please ask question based on this docs. |
| # Clone rocm-jax and run build.py | ||
| git clone git@github.com:ROCm/rocm-jax.git | ||
| cd jax_rocm_plugin | ||
| python3 build/build.py build |
There was a problem hiding this comment.
Did you miss \ in the end of this line?
There was a problem hiding this comment.
Also rocm-jax contains jax_rocm_plugin dir but there is no cd to rocm-jax before cd to jax_rocm_plugin. Is that just missing?
|
Hi @charleshofer, thanks for the doc! I think we need to clarify the goal of the XLA team. Most of the time, we don't need to build Docker images. What we really need is to build JAX and XLA with specific commits in the current container so we can run models in MaxText. As I understand, we need to build four components:
Two questions about the doc (https://github.com/ROCm/rocm-jax/blob/update-build-docs/BUILDING.md):
Some typical use cases
FYI: I think the installation of |
|
|
||
| ```shell | ||
| # Set your GFX targets to whatever you've got installed | ||
| AMDGPU_TARGETS="$(shell rocminfo | grep -o -m 1 'gfx.*')" |
There was a problem hiding this comment.
shell isn't a linux command and this line can't be executed directly.
| ```shell | ||
| git clone git@github.com:ROCm/jax.git | ||
| cd jax | ||
| python3.11 ./build/build.py build \ |
There was a problem hiding this comment.
Is a specific Python version needed here?
| Build artifacts are also produced by different commands to the `build/ci_build` | ||
| script. This build script does nearly all of its work inside of containers. | ||
| It requires that you have an installation of Docker and Python 3.6 or newer. | ||
|
|
There was a problem hiding this comment.
shall we have a section to have debug symbol build?
| AMDGPU_TARGETS="$(shell rocminfo | grep -o -m 1 'gfx.*')" | ||
|
|
||
| # Clone rocm-jax and run build.py | ||
| git clone git@github.com:ROCm/rocm-jax.git |
There was a problem hiding this comment.
Please, use https: link here, git one may require authorization.
Update the docs to describe how to use the
build.pywithout using the devsetup andstack.pyTODO: Draft PR. Don't merge yet. Need to add instructions on options for overriding the rocm/jax and rocm/xla version and test out commands with those combinations to make sure they just work.