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

Pin toolchain environment variables from configure->build time. #1590

Open
wants to merge 1 commit into
base: release/rocm-rel-6.3
Choose a base branch
from

Conversation

stellaraccident
Copy link

@stellaraccident stellaraccident commented Jan 23, 2025

Tensile uses a number of environment variables for controlling how it finds/uses its toolchain. However, there is no reliable way to pass these to hipBLASLt configure and have them stick at build time. This leads to all kinds of fallback paths on /opt/rocm and other issues.

This patch:

  • Fixes the Tensile add_custom_commands to launch commands in an env with critical variables set.
  • Uses project-consistent environment variables to find clang/assembler vs in two scripts vs hardcoding to /opt/rocm or requiring a ROCM_PATH.
  • Adds CMake cache variables Tensile_ROCM_OFFLOAD_BUNDLER_PATH and Tensile_ROCM_ASSEMBLER_PATH to explicitly allow controlling these paths via configuration.
  • Adds a Tensile_TOOLCHAIN_FLAGS env var and CMake setting. These flags will be prepended to any C/C++ compiler invocations and are used for explicit control of hip and bitcode library toolchain options (i.e. avoids spurious fallback to search heuristics that are less precise).

@stellaraccident stellaraccident changed the base branch from develop to release/rocm-rel-6.3 January 23, 2025 22:27
@stellaraccident stellaraccident changed the title Pin toolchain envPin toolchain environment variables from configure->build time. Pin toolchain environment variables from configure->build time. Jan 23, 2025
@stellaraccident stellaraccident marked this pull request as draft January 23, 2025 22:39
@stellaraccident
Copy link
Author

Hold for an update. Found an issue I need to roll in a fix for.

Tensile uses a number of environment variables for controlling how it finds/uses its toolchain. However, there is no reliable way to pass these to hipBLASLt configure and have them stick at build time. This leads to all kinds of fallback paths on /opt/rocm and other issues.

This patch:

* Fixes the Tensile add_custom_commands to launch commands in an `env` with critical variables set.
* Uses project-consistent environment variables to find clang/assembler vs in two scripts vs hardcoding to /opt/rocm or requiring a ROCM_PATH.
* Adds CMake cache variables `Tensile_ROCM_OFFLOAD_BUNDLER_PATH` and `Tensile_ROCM_ASSEMBLER_PATH` to explicitly allow controlling these paths via configuration.
* Adds a `Tensile_TOOLCHAIN_FLAGS` env var and CMake setting. These flags will be prepended to any C/C++ compiler invocations and are used for explicit control of hip and bitcode library toolchain options (i.e. avoids spurious fallback to search heuristics that are less precise).
@stellaraccident stellaraccident marked this pull request as ready for review January 23, 2025 23:26
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.

1 participant