[PR #15527] llm: set ROCm Tensile lib path #15189

Open
opened 2026-04-13 01:12:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15527
Author: @HEETMEHTA18
Created: 4/12/2026
Status: 🔄 Open

Base: mainHead: fix/rocm-tensile-libpath-15452-clean


📝 Commits (4)

  • 1a669a2 llm: set ROCm Tensile lib path
  • 3c09e42 llm: fill missing ROCm Tensile env vars
  • c7702ed llm: treat empty Tensile env values as unset
  • d7ba32e rocm: package hipblaslt library

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+5 -0)

📄 Description

Resolve rocBLAS Tensile path from bundled ROCm libs and pass it to the runner when unset. Add tests for path detection and env injection. rocblaslt error: Cannot read "TensileLibrary_lazy_gfx1200.dat": No such file or directory #15452

Summary

Fix ROCm Tensile library path resolution for runner startup on gfx1200-class systems.

On some ROCm setups, rocBLASLt first attempts a relative lookup for TensileLibrary_lazy_gfx1200.dat, logs a "No such file
or directory" warning, and then falls back to an absolute path. Inference may still work, but startup is noisy and path
resolution is fragile.

This patch makes lookup deterministic by resolving the Tensile library directory from gpuLibs and setting env vars at runner
startup when they are not already provided.

Changes

  • In llm/server.go:
    • Add findRocmTensileLibraryPath(gpuLibs []string) string
    • Add ensureRocmTensileEnv(gpuLibs []string, extraEnvs map[string]string) map[string]string
    • Call ensureRocmTensileEnv(...) in StartRunner(...) before environment assembly
  • Inject (only when unset):
    • ROCBLAS_TENSILE_LIBPATH
    • ROCBLASLT_TENSILE_LIBPATH
    • HIPBLASLT_TENSILE_LIBPATH
  • Supported candidate layouts:
    • <lib>/rocblas/library
    • <lib>/rocm/rocblas/library
  • Do not override user/process-provided env values.

Tests

Added unit tests in llm/server_test.go for:

  • Tensile path detection from both directory layouts
  • Injection behavior when env vars are unset
  • Non-overwrite behavior when env vars are explicitly set

Why this change

This addresses path-resolution fragility behind issue #15452 and removes noisy false-negative file lookup behavior in runner
startup.

Compatibility

  • No behavior change when env vars are already set by user/system.
  • No injection when a valid Tensile directory is not found.
  • Complements packaging-side fixes (e.g. hipBLASLt kernel packaging), but does not replace them.

Closes #15452


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15527 **Author:** [@HEETMEHTA18](https://github.com/HEETMEHTA18) **Created:** 4/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/rocm-tensile-libpath-15452-clean` --- ### 📝 Commits (4) - [`1a669a2`](https://github.com/ollama/ollama/commit/1a669a288de8a29a4cec61a6f37dac5ad7e56575) llm: set ROCm Tensile lib path - [`3c09e42`](https://github.com/ollama/ollama/commit/3c09e4241c59ebd386a8846adf456a744a872cfb) llm: fill missing ROCm Tensile env vars - [`c7702ed`](https://github.com/ollama/ollama/commit/c7702ed39ee77ed096a2110c384a02eced34cc31) llm: treat empty Tensile env values as unset - [`d7ba32e`](https://github.com/ollama/ollama/commit/d7ba32e8e330ccad37dd54fee56dd84fc16562c8) rocm: package hipblaslt library ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+5 -0) </details> ### 📄 Description Resolve rocBLAS Tensile path from bundled ROCm libs and pass it to the runner when unset. Add tests for path detection and env injection. rocblaslt error: Cannot read "TensileLibrary_lazy_gfx1200.dat": No such file or directory #15452 ## Summary Fix ROCm Tensile library path resolution for runner startup on gfx1200-class systems. On some ROCm setups, `rocBLASLt` first attempts a relative lookup for `TensileLibrary_lazy_gfx1200.dat`, logs a "No such file or directory" warning, and then falls back to an absolute path. Inference may still work, but startup is noisy and path resolution is fragile. This patch makes lookup deterministic by resolving the Tensile library directory from `gpuLibs` and setting env vars at runner startup when they are not already provided. ## Changes - In `llm/server.go`: - Add `findRocmTensileLibraryPath(gpuLibs []string) string` - Add `ensureRocmTensileEnv(gpuLibs []string, extraEnvs map[string]string) map[string]string` - Call `ensureRocmTensileEnv(...)` in `StartRunner(...)` before environment assembly - Inject (only when unset): - `ROCBLAS_TENSILE_LIBPATH` - `ROCBLASLT_TENSILE_LIBPATH` - `HIPBLASLT_TENSILE_LIBPATH` - Supported candidate layouts: - `<lib>/rocblas/library` - `<lib>/rocm/rocblas/library` - Do not override user/process-provided env values. ## Tests Added unit tests in `llm/server_test.go` for: - Tensile path detection from both directory layouts - Injection behavior when env vars are unset - Non-overwrite behavior when env vars are explicitly set ## Why this change This addresses path-resolution fragility behind issue #15452 and removes noisy false-negative file lookup behavior in runner startup. ## Compatibility - No behavior change when env vars are already set by user/system. - No injection when a valid Tensile directory is not found. - Complements packaging-side fixes (e.g. hipBLASLt kernel packaging), but does not replace them. Closes #15452 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 01:12:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#15189