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

Method Service

tensorflow/compiler/xla/service/service.cc:157–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157Service::Service(const ServiceOptions& options,
158 std::unique_ptr<Backend> execute_backend)
159 : options_(options),
160 allocation_tracker_(execute_backend.get()),
161 execute_backend_(std::move(execute_backend)) {
162 CHECK_GT(options_.number_of_replicas(), 0);
163 if (execute_backend_) {
164 if (execute_backend_->device_count() > 0) {
165 CHECK_GE(execute_backend_->device_count(), options_.number_of_replicas())
166 << "Requested more replicas than there are devices.";
167 }
168 LOG(INFO) << StrFormat(
169 "XLA service %p initialized for platform %s (this does not guarantee "
170 "that XLA will be used). Devices:",
171 this, execute_backend_->platform()->Name());
172 auto stream_executors = execute_backend_->stream_executors();
173 for (int i = 0; i < execute_backend_->device_count(); ++i) {
174 se::StreamExecutor* executor = stream_executors.at(i);
175 const auto& description = executor->GetDeviceDescription();
176 LOG(INFO) << StrFormat(" StreamExecutor device (%d): %s, %s", i,
177 description.name(),
178 description.platform_version());
179 }
180 } else {
181 VLOG(1) << "XLA compile-only service constructed";
182 }
183}
184
185Status Service::CreateChannelHandle(const CreateChannelHandleRequest* arg,
186 CreateChannelHandleResponse* result) {

Callers

nothing calls this directly

Calls 7

nameMethod · 0.65
getMethod · 0.45
number_of_replicasMethod · 0.45
device_countMethod · 0.45
NameMethod · 0.45
platformMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected