Forums - Softmax Runtime Failure on GPU

3 posts / 0 new
Last post
Softmax Runtime Failure on GPU
jason2
Join Date: 17 Aug 21
Posts: 14
Posted: Fri, 2023-07-21 14:12

Hi,

We have succesfully converted our model to dlc format.  Our model contains a 1x5376 Softmax layer.  At runtime, when we try to create a  std::unique_ptr<zdl::SNPE::SNPE> via the build() function.  We receive a nullptr.  Checking the last error, I see message=Layer parameter value is invalid. error_code=1002; error_message=Layer parameter value is invalid. No backend could validate Op=softmax_0 Type=Softmax error code=3110; error_component=Model Validation
Additionally, when I enable verbose logging, the only error message I see is [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10021.
Can you give us any guidance on what might be causing this error?  Executing on CPU seems to work without issue.

This is snpe-2.9.0.4462, running on a Snapdragon 8 Gen1.

Thanks,

Jason

  • Up0
  • Down0
yunxqin
Join Date: 2 Mar 23
Posts: 44
Posted: Tue, 2023-07-25 22:52

Dear developer,

What's the commands you used at the runtime.

BR.

Yunxiang

  • Up0
  • Down0
jason2
Join Date: 17 Aug 21
Posts: 14
Posted: Tue, 2023-08-01 08:24

Hi Yunxiang,

Thanks for responding.  The function we have written to initialize the SNPE looks like this:

prop_error prop_load_accelerated_model(const std::string& model_path,
                                     std::unique_ptr<zdl::DlContainer::IDlContainer>& container,
                                     std::unique_ptr<zdl::SNPE::SNPE>& snpe)
{
    container = zdl::DlContainer::IDlContainer::open(model_path);
    if (!container)
        return "Failed to open SNPE container file!";
 
    zdl::SNPE::SNPEBuilder snpeBuilder(container.get());
    zdl::DlSystem::RuntimeList runtimeList;
    zdl::DlSystem::PlatformConfig platformConfig;
    runtimeList.add(zdl::DlSystem::Runtime_t::GPU_FLOAT16);
 
    snpe = snpeBuilder.setOutputLayers({})
        .setUnconsumedTensorsAsOutputs(true)
        .setRuntimeProcessorOrder(runtimeList)
        .setUseUserSuppliedBuffers(false)
        .setPlatformConfig(platformConfig)
        .setInitCacheMode(false)
        .build();
    if (!snpe) {
        static std::string err{"Failed to create SNPE runtime object - got error string: "};
        err.append(zdl::DlSystem::getLastErrorString());
        err.append("\nerror code: ");
        err.append(std::to_string(zdl::DlSystem::enumToUInt32(zdl::DlSystem::getLastErrorCode())));
        err.append("\nerror info: ");
        err.append(zdl::DlSystem::getLastInfoString());
        return err.c_str();
    }
 
    return nullptr;
}
 
The error returned by this function is:
error_code=1002; error_message=Layer parameter value is invalid. error_code=1002; error_message=Layer parameter value is invalid. No backend could validate Op=softmax_0 Type=Softmax error code=3110; error_component=Model Validation; line_no=652; thread_id=519040122032; error_component=Model Validation; line_no=272; thread_id=517028519088
 
As I said, I've also turned on verbose logging, which is giving us the errror:
 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10021.
 
Note that this initialization function performs successfully on other DLC files that do not use Softmax layers.
 
What should we do to debug this further?
 
Respectfully,
Jason
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.