MindSpore中的mindspore.numpy.bincount 大数值情况下报ValueError
收藏回复举报
MindSpore中的mindspore.numpy.bincount 大数值情况下报ValueError
发表于2023-03-20 19:19:44
0 查看

1 系统环境

硬件环境(Ascend/GPU/CPU): GPU

MindSpore版本: 1.9.0

执行模式(PyNative/ Graph): PyNative模式

Python版本: 3.9.12

操作系统平台: Linux

2 报错信息

2.1 问题描述

mindspore.numpy.bincount GPU环境中在大数值情况下报错。

2.2 报错信息

ValueError: The total size of the tensor exceeds the max_limit of 2 Giga-elements, which is 2500000000 elements ([const vector][50000, 50000]).
----------------------------------------------------
- C++ Call Stack: (For framework developers)
----------------------------------------------------
mindspore/ccsrc/plugin/device/gpu/kernel/gpu_kernel.h:402 CheckTensorSize

2.3 脚本代码(代码格式,可上传附件)

from mindspore import context
import mindspore as ms
import mindspore.numpy as np

b = np.bincount(np.arange(50000))
print(b)

3 根因分析

******此处由用户补充详细的定位过程******

4 解决方案

******此处由用户填写******

包含文字方案和最终脚本代码

支持上传附件

我要发帖子