generate appropriate error when debugger is used with dataset_sink_mode=True

pull/8005/head
Harshvardhan Gupta 4 years ago
parent 5e8858e561
commit e6451adc50

@ -418,14 +418,7 @@ void GPUSession::PostIterationDbg(const std::shared_ptr<KernelGraph> &kernel_gra
}
void GPUSession::PreLoadTensor(const std::shared_ptr<KernelGraph> &kernel_graph) const {
// check the dump_enabled and dataset_sink_mode
bool dump_enabled = DumpDataEnabledIteration();
auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
if (dump_enabled && ConfigManager::GetInstance().dataset_mode() == DS_SINK_MODE) {
MS_EXCEPTION(NotSupportError) << "Don't support set dataset_sink_mode to True when using e2e_dump";
}
if (!(debugger_ && (debugger_->debugger_enabled() || dump_enabled))) {
return;
}

@ -32,6 +32,7 @@
#include "runtime/device/kernel_runtime_manager.h"
#include "runtime/device/kernel_runtime.h"
#include "debug/data_dump/e2e_dump_util.h"
#include "utils/config_manager.h"
using debugger::EventReply;
using debugger::GraphProto;
@ -71,9 +72,9 @@ Debugger::Debugger()
// configure partial memory reuse
partial_memory_ = CheckDebuggerPartialMemoryEnabled();
// switch memory reuse on or off
auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
// switch memory reuse on or off
context_ptr->set_param<bool>(MS_CTX_ENABLE_MEM_REUSE, partial_memory_);
// print some message about memory reuse to user
if (partial_memory_) {
@ -194,6 +195,18 @@ void Debugger::EnableDebugger() {
debug_services_ = std::make_unique<DebugServices>();
}
void Debugger::CheckDatasetSinkMode() {
if (CheckDebuggerDumpEnabled() && ConfigManager::GetInstance().dataset_mode() == DS_SINK_MODE) {
MS_EXCEPTION(NotSupportError)
<< "e2e_dump not supported on GPU with dataset_sink_mode=True. Please set dataset_sink_mode=False";
}
if (CheckDebuggerEnabled() && ConfigManager::GetInstance().dataset_mode() == DS_SINK_MODE) {
MS_EXCEPTION(NotSupportError)
<< "Debugger is not supported with dataset_sink_mode=True. Please set dataset_sink_mode=False";
}
}
bool Debugger::CheckDebuggerDumpEnabled() {
// see if dump is enabled
if (device_target_ == kGPUDevice) {
@ -247,6 +260,7 @@ void Debugger::Reset() {
void Debugger::PreExecute(const KernelGraphPtr &graph_ptr) {
// access lock for public method
std::lock_guard<std::mutex> a_lock(access_lock_);
CheckDatasetSinkMode();
if (debugger_->DebuggerBackendEnabled()) {
// check and save graph_ptr, suspend if graph is new
CheckGraphPtr(graph_ptr);

@ -111,6 +111,8 @@ class Debugger : public std::enable_shared_from_this<Debugger> {
void LoadGraphOutputs();
void CheckDatasetSinkMode();
private:
// private constructor for singleton
Debugger();

Loading…
Cancel
Save