| 155 | } |
| 156 | |
| 157 | Service::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 | |
| 185 | Status Service::CreateChannelHandle(const CreateChannelHandleRequest* arg, |
| 186 | CreateChannelHandleResponse* result) { |
nothing calls this directly
no test coverage detected