Skip to content

Backport gfx r2.21 - #3268

Merged
hsharsha merged 5 commits into
r2.21-rocm-enhancedfrom
backport-gfx-r2.21
Nov 29, 2026
Merged

hsharsha merged 5 commits into
r2.21-rocm-enhancedfrom
backport-gfx-r2.21

Conversation

@hsharsha

Copy link
Copy Markdown
Collaborator

Submission Checklist

fbyrne and others added 5 commits November 27, 2026 14:26
(cherry picked from commit 4de0b95)
…ta for ROCm 10.2 only!

Imported from GitHub PR openxla/xla#51088

Add `rocm_path("lib/llvm/lib/libomp.so*")` to the `hipblaslt` runtime data in `third_party/gpus/rocm/BUILD.tpl`, next to `libtensilelite-host.so*`. The ROCm 10.2 release keeps this dependency; later ROCm builds no longer link OpenMP into `libtensilelite-host`.

In ROCm 10.2, `libhipblaslt.so.1` depends on `libtensilelite-host.so.1`, which needs `libomp.so` and finds it through `$ORIGIN/llvm/lib`. tensorflow#50239 added `libtensilelite-host.so*` to the `hipblaslt` data but not `libomp.so`, so `rocm_dist/lib/llvm/lib/libomp.so` is missing from runfiles and anything that loads hipBLASLt from a 10.2 install fails before `main`:

```
error while loading shared libraries: libomp.so: cannot open shared object file: No such file or directory
```

This currently breaks the ROCm 10.2 nightly test runs, including the JAX unit tests in ROCm/xla's CI, where `xla_rocm_plugin.so` fails to load and every GPU test falls back to "Unknown backend: 'gpu'". ROCm 10.0 is unaffected because none of its math libraries need `libomp`.

A `cc_test` depending on `@local_config_rocm//rocm:hipblaslt` that calls `dlopen("libhipblaslt.so.1", RTLD_NOW)`, built with `--config=rocm` and `ROCM_PATH` set to the TheRock pip install (`rocm-sdk path --root`), in the rocmless CI image:

| ROCm | Before | After |
|---|---|---|
| 10.2.0a20261016 | fails: `libomp.so: cannot open shared object file` | passes; `libomp.so` loads next to `libtensilelite-host.so.1` |
| 10.0.0 | n/a | passes |

End to end: jax-ml/jax `main` Bazel GPU tests (`build/rocm/ci_test_targets.txt`, `--//jax:build_jaxlib=wheel`, the ROCm/xla CI flags without RBE) on a local gfx950 with TheRock 10.2.0a20261016 from pip and this change applied via `--override_repository=xla`: 147 of 147 tests pass. Reverting this change, `//tests:cholesky_update_test_gpu` fails with `libomp.so: cannot open shared object file`, as in CI.

`--incompatible_disallow_empty_glob=false` is set in both XLA's and JAX's `.bazelrc`, so ROCm installs without `libomp` are unaffected.

Copybara import of the project:

--
c95b6b5f418254a324a032bfb907fd4459af267a by gulsumgudukbay <gudukbay@gmail.com>:

[ROCm] Add libomp.so to the hipblaslt runtime data

libtensilelite-host.so needs libomp.so and finds it through $ORIGIN/llvm/lib. Without libomp in runfiles, binaries that load hipBLASLt from ROCm 10.2 fail with "libomp.so: cannot open shared object file".

Merging this change closes tensorflow#51088

PiperOrigin-RevId: 1018104611
(cherry picked from commit a85d8ba)
(cherry picked from commit 64c1d6b)
(cherry picked from commit 5eac230)

@i-chaochen i-chaochen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we let agent to review these kind of PRs later on

@hsharsha
hsharsha merged commit 0e3b2ec into r2.21-rocm-enhanced Nov 29, 2026
2 of 3 checks passed
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.

4 participants