!10145 LoadTensors was using a 4-byte size field instead of an 8-byte size field

From: @john_tzanakakis
Reviewed-by: @wenkai_dist,@mikef
Signed-off-by:
pull/10145/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 6f6ec748e3

@ -207,7 +207,7 @@ void DebugServices::CheckWatchpoints(std::vector<std::string> *name, std::vector
}
void DebugServices::ReadNodesTensors(std::vector<std::string> name, std::vector<std::string> *ret_name,
std::vector<char *> *data_ptr, std::vector<unsigned int> *data_size,
std::vector<char *> *data_ptr, std::vector<ssize_t> *data_size,
std::vector<TypePtr> *dtype, std::vector<std::vector<int64_t>> *shape) {
std::vector<std::tuple<std::string, std::shared_ptr<TensorData>>> result_list;
tensor_loader_->SearchTensors(name, &result_list);

@ -180,8 +180,8 @@ class DebugServices {
const bool step_end, const bool recheck);
void ReadNodesTensors(std::vector<std::string> name, std::vector<std::string> *ret_name,
std::vector<char *> *data_ptr, std::vector<unsigned int> *data_size,
std::vector<TypePtr> *dtype, std::vector<std::vector<int64_t>> *shape);
std::vector<char *> *data_ptr, std::vector<ssize_t> *data_size, std::vector<TypePtr> *dtype,
std::vector<std::vector<int64_t>> *shape);
bool IsWatchPoint(const std::string &kernel_name, const CNodePtr &kernel = nullptr) const;

@ -736,7 +736,7 @@ std::list<TensorProto> Debugger::LoadTensors(const ProtoVector<TensorProto> &ten
std::vector<std::string> name;
std::vector<std::string> ret_name;
std::vector<char *> data_ptr;
std::vector<unsigned int> data_size;
std::vector<ssize_t> data_size;
std::vector<TypePtr> dtype;
std::vector<std::vector<int64_t>> shape;
@ -749,7 +749,7 @@ std::list<TensorProto> Debugger::LoadTensors(const ProtoVector<TensorProto> &ten
unsigned int result_index = 0;
for (auto tensor : tensors) {
int size_iter = 0;
ssize_t size_iter = 0;
if (result_index >= ret_name.size() || ret_name[result_index] != GetTensorFullName(tensor)) {
TensorProto tensor_item;
tensor_item.set_finished(true);
@ -757,9 +757,9 @@ std::list<TensorProto> Debugger::LoadTensors(const ProtoVector<TensorProto> &ten
tensor_list.push_back(tensor_item);
continue;
}
int tensor_size = data_size[result_index];
ssize_t tensor_size = data_size[result_index];
while (size_iter < tensor_size) {
int chunk_size = CHUNK_SIZE;
ssize_t chunk_size = CHUNK_SIZE;
TensorProto tensor_item;
tensor_item.set_finished(false);
if (tensor_size - size_iter <= CHUNK_SIZE) {

@ -131,6 +131,10 @@ void LoadKernelData(Debugger *debugger, const CNodePtr &kernel,
std::string input_kernel_name = input_kernel->fullname_with_scope();
auto addr = kernel_inputs[j];
auto type = AnfAlgo::GetOutputInferDataType(input_kernel, PARAMETER_OUTPUT_INDEX);
// For example, this happens with the Depend op
if (type == kMetaTypeNone) {
continue;
}
auto format = kOpFormat_DEFAULT;
auto gpu_addr = std::make_unique<GPUDeviceAddress>(addr->addr, addr->size, format, type);
string input_tensor_name = input_kernel_name + ':' + "0";
@ -157,6 +161,10 @@ void LoadKernelData(Debugger *debugger, const CNodePtr &kernel,
for (int j : real_outputs) {
auto addr = kernel_outputs[j];
auto type = AnfAlgo::GetOutputInferDataType(kernel, j);
// For example, this happens with the Depend op
if (type == kMetaTypeNone) {
continue;
}
auto format = kOpFormat_DEFAULT;
auto gpu_addr = std::make_unique<GPUDeviceAddress>(addr->addr, addr->size, format, type);
string tensor_name = kernel_name + ':' + std::to_string(j);

Loading…
Cancel
Save