-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[BugFix] Fix the error of reloading the model library on the ROCm platform: "MIOpen Error: No invoker was registered for convolution forward.” #16190
Conversation
7ae6725
to
3a900bb
Compare
Thakns @Liangxijun-1001 . I think in this case, maybe we should ignore the fwd_algo in entry(decided in compile time) and then use the algorithm returned by the miopenFindConvolutionForwardAlgorithm |
entry_ptr->handle, entry_ptr->conv_entry.input_desc, x->data, | ||
entry_ptr->conv_entry.filter_desc, w->data, entry_ptr->conv_entry.conv_desc, | ||
entry_ptr->conv_entry.output_desc, y->data, request_algo_count, &returned_algo_count, | ||
perfs, workspace, workspace_size, exhaustive_search)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider reset entry_ptr->fwd_algo to simply the best returned algo
input_shape: (1, 3, 224, 224) |
…m platform: MIOpen Error: No invoker was registered for convolution forward. Signed-off-by: Liangxijun-1001 <[email protected]>
3a900bb
to
97be768
Compare
My env:AMD RX 7600
I debugged the MIOpen source code for a specific reason. During the model compilation phase, the Python side calls the conv2d.setup interface, invoking MIOpen's findConvForwardAlgorithm interface to find the appropriate algorithm. Subsequently, the corresponding <layer-Problem, Algorithm> pair is registered within the current invokers. Then, without terminating the current process, during the inference stage, the invoker can identify the Algorithm for the corresponding layer-problem and perform direct inference.
However, if the current process is exited and the pre-compiled model is executed without the prior invocation of findConvForwardAlgorithm during the compilation phase, the corresponding <layer-Problem, Algorithm> pair won't be registered within the invokers. As a result, the inference stage will report an error stating "MIOpen Error: No invoker was registered for convolution forward."
Based on the distinction between MIOpen and cuDNN invocation provided by the MIOpen official documentation, the typical sequence for calling Convolution APIs in MIOpen is as follows:
miopenConvolution*GetWorkSpaceSize(): This function returns the workspace size required by the Find() operation.
miopenFindConvolution*Algorithm(): This function returns performance information about various algorithms.
miopenConvolution*(): Actual convolution operation.
The official documentation emphasizes that calling miopenFindConvolution*Algorithm() is mandatory before using any Convolution API.
Additionally, according to the documentation found at https://rocm.docs.amd.com/projects/MIOpen/en/latest/convolution.html#miopenfindconvolutionforwardalgorithm, the last parameter of the miopenFindConvolutionForwardAlgorithm interface, exhaustiveSearch, should be set to 1 (true):
If exhaustiveSearch == 0, MIOpen will seek the first kernel with a configuration match. If no configuration match is found, a default configuration will be returned.
If exhaustiveSearch == 1, MIOpen will search for the best kernel for the provided configuration. If a match is not found, an exhaustive search is performed by running individual algorithms.
For further details refer to this link: https://rocmdocs.amd.com/projects/MIOpen/en/latest/MIOpen_Porting_Guide.html
cc: @tqchen @masahi @Lunderberg