Repository navigation
Conversation
MIOPEN_HIPCONV_SANITIZER / MIOPEN_CKIMPL_SANITIZER (set to OFF) strip sanitizer instrumentation from these two targets only. Their dense per-arch/per-Config template instantiation grows ASAN's stack-use-after-return descriptors enough to push a R_X86_64_PC32 relocation past its +/-2GB range, failing libMIOpen.so's (hipconv) or a CK plugin's own (ck_impl) link. The rest of MIOpen keeps full ASAN/TSAN coverage.
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Nightly ASAN builds have failed two nights running when
ld.lldlinkslibMIOpen.so, withrelocation R_X86_64_PC32 out of rangeerrors.libMIOpen.sostatically linkshipconvand MIOpen's ownai_heuristics.cppdirectly, and ASAN's stack-use-after-return instrumentation on their dense, per-arch/per-kernel templated code has grown that link past the linker's +/-2GB PC-relative relocation limit. This is cumulative image bloat from ordinary kernel/feature growth (e.g. #13718, #14627), not a defect in any single PR, and will keep recurring as more kernels land.ISSUE ID : ROCm/TheRock#9812
Technical Details
Adds
MIOPEN_HIPCONV_SANITIZERandMIOPEN_CKIMPL_SANITIZERCACHE options, consumed inhipconv's andck_impl's ownCMakeLists.txt. When set toOFF, each strips-fsanitize=addressfrom just that component:hipconv: compile-option override only, on both the mainhipconvtarget and each per-arch object-library target in_arch_targets(where the oversized template instantiations actually live).hipconvcontributes object files/a static archive intolibMIOpen.so's own link, not a link of its own, so there's no link step to override.ck_impl: both compile- and link-option overrides, applied perMIOpenCKGroupedConv_<arch>plugin target — each is its ownSHAREDlibrary with its own independent link step, mirroring the existingMIOPEN_DISABLE_DEVICE_UBSANpattern already in this file. Unlike that UBSan precedent, this isn't-Xarch_device-scoped: the failures we're seeing are in host-side kernel-launcher code (under this build's unscoped, full-ASANmode), so both host and device instrumentation are dropped here.Neither option affects the rest of MIOpen, which keeps full ASAN/TSAN coverage. Both default to unset (no override, today's behavior unchanged) and are driven by matching preset knobs in ROCm/TheRock's
CMakePresets.json(companion PR).Mixing instrumented and uninstrumented code in one process is a standard, supported ASAN configuration — allocation/deallocation is intercepted process-wide regardless of which TU allocated or freed, and the sanitizer flag doesn't change a function's ABI. The tradeoff is narrower detection coverage: a memory bug originating purely inside
hipconv/ck_impl's own code won't be caught at the point of fault anymore (though resulting heap corruption can still sometimes surface later via instrumented code touching the same memory).Test Plan
libMIOpen.so's ASAN link succeeds with feat(ck): TDM and named barriers in wavelet pipeline conv fwd #13718 reverted (ROCm/TheRock run 42324389102)