aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
authorGravatar Benjamin Kramer <kramerb@google.com>2018-07-27 11:04:02 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-27 11:09:45 -0700
commit85a265031bbd61f5924cdbfdc316df6979883581 (patch)
treee0f28efca4c3c3d0529f65d22bd361bc9900ee46 /tensorflow
parent22107ea509d16803f33f723d54d313b9be5622cc (diff)
[XLA:GPU] Only add the cubin if it is available
It's only non-empty if we were able to run ptxas. If the PTX is going to be JIT'ed by the driver it won't be around. Loading an empty cubin will result in a fatal error. PiperOrigin-RevId: 206341931
Diffstat (limited to 'tensorflow')
-rw-r--r--tensorflow/compiler/xla/service/gpu/gpu_executable.cc4
-rw-r--r--tensorflow/stream_executor/module_spec.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/gpu/gpu_executable.cc b/tensorflow/compiler/xla/service/gpu/gpu_executable.cc
index 52c8595ffb..0179b43240 100644
--- a/tensorflow/compiler/xla/service/gpu/gpu_executable.cc
+++ b/tensorflow/compiler/xla/service/gpu/gpu_executable.cc
@@ -190,7 +190,9 @@ GpuExecutable::ResolveConstantGlobals(se::StreamExecutor* executor) {
}
se::MultiModuleLoaderSpec module_spec;
- module_spec.AddCudaCubinInMemory(cubin());
+ if (!cubin().empty()) {
+ module_spec.AddCudaCubinInMemory(cubin());
+ }
module_spec.AddCudaPtxInMemory(ptx().c_str());
tensorflow::gtl::FlatMap<int64, se::DeviceMemoryBase> globals;
diff --git a/tensorflow/stream_executor/module_spec.h b/tensorflow/stream_executor/module_spec.h
index 212ae7ba9c..75bdfed2d7 100644
--- a/tensorflow/stream_executor/module_spec.h
+++ b/tensorflow/stream_executor/module_spec.h
@@ -43,6 +43,7 @@ class MultiModuleLoaderSpec {
}
void AddCudaCubinInMemory(port::ArraySlice<const uint8> cubin_bytes) {
+ CHECK(!cubin_bytes.empty());
has_cuda_cubin_in_memory_ = true;
cuda_cubin_in_memory_ = cubin_bytes;
}