File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2002,5 +2002,28 @@ TRITONBACKEND_ModelInstanceFinalize(TRITONBACKEND_ModelInstance* instance)
20022002 return nullptr ;
20032003}
20042004
2005+ TRITONSERVER_Error*
2006+ TRITONBACKEND_GetBackendAttribute (
2007+ TRITONBACKEND_Backend* backend,
2008+ TRITONBACKEND_BackendAttribute* backend_attributes)
2009+ {
2010+ LOG_MESSAGE (
2011+ TRITONSERVER_LOG_VERBOSE,
2012+ " TRITONBACKEND_GetBackendAttribute: setting attributes" );
2013+ // Specify different preferred instance kind based on backend compatibility,
2014+ // so Triton core won't blindly auto-complete kind that may not be supported.
2015+ // Other instance groups setting are set to "no value" so that Triton core
2016+ // will auto-complete them with default policy.
2017+ #ifdef TRITON_ENABLE_GPU
2018+ RETURN_IF_ERROR (TRITONBACKEND_BackendAttributeAddPreferredInstanceGroup (backend_attributes,
2019+ TRITONSERVER_INSTANCEGROUPKIND_GPU, 0 , nullptr , 0 ));
2020+ #else
2021+ RETURN_IF_ERROR (TRITONBACKEND_BackendAttributeAddPreferredInstanceGroup (backend_attributes,
2022+ TRITONSERVER_INSTANCEGROUPKIND_CPU, 0 , nullptr , 0 ));
2023+ #endif
2024+
2025+ return nullptr ;
2026+ }
2027+
20052028} // extern "C"
20062029}}} // namespace triton::backend::python
You can’t perform that action at this time.
0 commit comments