Skip to content
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

高通8Gen3设备上使用QNN的HTP加速效果不理想 #239

Open
WangHao311 opened this issue Aug 23, 2024 · 0 comments
Open

高通8Gen3设备上使用QNN的HTP加速效果不理想 #239

WangHao311 opened this issue Aug 23, 2024 · 0 comments

Comments

@WangHao311
Copy link

您好,
大佬,借贵宝地,请问一下,为什么我在高通8Gen3设备上使用QNN的HTP加速,感觉效果很差,没有达到加速效果呢?

  • x86:Python下,使用cuda,模型单次推理13ms;
  • android:QNN下,使用HTP,模型单次推理106ms。

设置了QnnHtpPerfInfrastructure_PowerConfig_t如下:

sample_app::StatusCode sample_app::QnnSampleApp::setBurstPerformanceMode() {
    QnnHtpPerfInfrastructure_PowerConfig_t powerConfig;
    memset(&powerConfig, 0, sizeof(powerConfig));
    powerConfig.option = QNN_HTP_PERF_INFRASTRUCTURE_POWER_CONFIGOPTION_DCVS_V3;
    powerConfig.dcvsV3Config.dcvsEnable = 0;
    powerConfig.dcvsV3Config.setDcvsEnable = 1;
    powerConfig.dcvsV3Config.contextId = m_powerConfigId;
    powerConfig.dcvsV3Config.powerMode = QNN_HTP_PERF_INFRASTRUCTURE_POWERMODE_PERFORMANCE_MODE;
    powerConfig.dcvsV3Config.setSleepLatency = 1; // True to consider Latency parameter otherwise False
    powerConfig.dcvsV3Config.setBusParams = 1; // True to consider Bus parameter otherwise False
    powerConfig.dcvsV3Config.setCoreParams = 1; // True to consider Core parameter otherwise False
    powerConfig.dcvsV3Config.sleepDisable = 0; // True to consider sleep/LPM modes, False to enable
    powerConfig.dcvsV3Config.setSleepDisable = 0; // True to consider sleep disable/enable parameter otherwise False
    powerConfig.dcvsV3Config.sleepLatency = 40; // range 40-2000 micro sec
    powerConfig.dcvsV3Config.busVoltageCornerMin = DCVS_VOLTAGE_VCORNER_MAX_VOLTAGE_CORNER;
    powerConfig.dcvsV3Config.busVoltageCornerTarget = DCVS_VOLTAGE_VCORNER_MAX_VOLTAGE_CORNER;
    powerConfig.dcvsV3Config.busVoltageCornerMax = DCVS_VOLTAGE_VCORNER_MAX_VOLTAGE_CORNER;
    powerConfig.dcvsV3Config.coreVoltageCornerMin = DCVS_VOLTAGE_VCORNER_MAX_VOLTAGE_CORNER;
    powerConfig.dcvsV3Config.coreVoltageCornerTarget = DCVS_VOLTAGE_VCORNER_MAX_VOLTAGE_CORNER;
    powerConfig.dcvsV3Config.coreVoltageCornerMax = DCVS_VOLTAGE_VCORNER_MAX_VOLTAGE_CORNER;

    const QnnHtpPerfInfrastructure_PowerConfig_t *powerConfigs[] =
            {&powerConfig, NULL};
    if (m_perfInfra) {
        m_perfInfra->setPowerConfig(m_powerConfigId, powerConfigs);
    }
    return StatusCode::SUCCESS;
}
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

No branches or pull requests

1 participant