Update ROCm to not hang when running on complex RNN models (#20118)

* Update ROCm to not hang when running on complex RNN models

* Formatting
This commit is contained in:
Nicolas Mowen 2025-09-17 18:26:32 -06:00 committed by GitHub
parent 1efff67e32
commit c05e260ae9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -67,6 +67,9 @@ FROM deps-prelim AS rocm-prelim-hsa-override0
ENV HSA_ENABLE_SDMA=0 ENV HSA_ENABLE_SDMA=0
ENV TF_ROCM_USE_IMMEDIATE_MODE=1 ENV TF_ROCM_USE_IMMEDIATE_MODE=1
# avoid kernel crashes
ENV HIP_FORCE_DEV_KERNARG=1
COPY --from=rocm-dist / / COPY --from=rocm-dist / /
RUN ldconfig RUN ldconfig

View File

@ -51,6 +51,15 @@ class ONNXDetector(DetectionApi):
"enable_cuda_graph": True, "enable_cuda_graph": True,
} }
sess_options = None
if providers[0] == "ROCMExecutionProvider":
# avoid AMD GPU kernel crashes
sess_options = ort.SessionOptions()
sess_options.graph_optimization_level = (
ort.GraphOptimizationLevel.ORT_DISABLE_ALL
)
self.model = ort.InferenceSession( self.model = ort.InferenceSession(
path, providers=providers, provider_options=options path, providers=providers, provider_options=options
) )