Skip to content

runtime: hard-fail mgpuModuleLoadJIT on HIP#748

Open
fallintoplace wants to merge 1 commit into
ROCm:mainfrom
fallintoplace:fix-rocm-arch-autodetect
Open

runtime: hard-fail mgpuModuleLoadJIT on HIP#748
fallintoplace wants to merge 1 commit into
ROCm:mainfrom
fallintoplace:fix-rocm-arch-autodetect

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

mgpuModuleLoadJIT in the ROCm runtime wrappers previously used assert(false) and then returned nullptr on HIP builds.

In release builds (NDEBUG), that assertion is stripped, so callers could continue with a null module pointer and fail later in opaque ways.

This change makes the function fail fast in all configurations by:

  • Emitting an explicit diagnostic to stderr.
  • Calling std::abort() unconditionally in mgpuModuleLoadJIT.

Behavior impact

  • Before: unsupported path could silently continue and produce downstream errors.
  • After: execution stops immediately with a clear runtime message, matching the hard-fail intent and avoiding undefined behavior from dereferencing/using nullptr.

Validation

  • Not run in this change.

Files

  • lib/Runtime/ROCm/FlyRocmRuntimeWrappers.cpp

@fallintoplace fallintoplace force-pushed the fix-rocm-arch-autodetect branch from 8c0c6b9 to 3faf638 Compare June 25, 2026 17:22
@fallintoplace fallintoplace force-pushed the fix-rocm-arch-autodetect branch from 3faf638 to 38a0b2c Compare June 25, 2026 17:24
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