MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TRITONTF_ModelMakeCallable

Function TRITONTF_ModelMakeCallable

addons/triton/tensorflow_backend_tf.cc:1106–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1104}
1105
1106TRITONTF_Error*
1107TRITONTF_ModelMakeCallable(
1108 TRITONTF_Model* model, const char** input_names,
1109 const TRITONTF_DataType* input_types, const size_t num_inputs,
1110 const char** output_names, const TRITONTF_DataType* output_types,
1111 const size_t num_outputs)
1112{
1113 ModelImpl* m = reinterpret_cast<ModelImpl*>(model);
1114
1115 const auto& device_name = m->DeviceName();
1116 if (device_name.empty()) {
1117 return TRITONTF_ErrorNew(
1118 "model session does not have an assigned GPU device");
1119 }
1120
1121 tensorflow::CallableOptions opts;
1122 for (size_t i = 0; i < num_inputs; ++i) {
1123 const std::string input_name = input_names[i];
1124 opts.add_feed(input_name);
1125 if (IsGPUFeedAndFetchSupported(input_types[i])) {
1126 opts.mutable_feed_devices()->insert({input_name, device_name});
1127 }
1128 }
1129
1130 for (size_t i = 0; i < num_outputs; ++i) {
1131 const std::string output_name = output_names[i];
1132 opts.add_fetch(output_name);
1133 if (IsGPUFeedAndFetchSupported(output_types[i])) {
1134 opts.mutable_fetch_devices()->insert({output_name, device_name});
1135 }
1136 }
1137
1138 // CallableOptions.fetch_skip_sync = false is not yet implemented, we
1139 // will have to synchronize after the callable is run.
1140 opts.set_fetch_skip_sync(true);
1141
1142 return m->MakeCallable(opts);
1143}
1144
1145TRITONTF_Error*
1146TRITONTF_ModelRun(

Callers

nothing calls this directly

Calls 8

TRITONTF_ErrorNewFunction · 0.85
DeviceNameMethod · 0.45
emptyMethod · 0.45
add_feedMethod · 0.45
insertMethod · 0.45
add_fetchMethod · 0.45
MakeCallableMethod · 0.45

Tested by

no test coverage detected