msprof op和msprof op simulator的算子打印输出为什么不一样
收藏回复举报
msprof op和msprof op simulator的算子打印输出为什么不一样
t('forum.solved') 已解决
发表于2026-04-10 16:47:57
0 查看
比如triton-ascend的tutorials中的layer-norm算子,在msprof op simulator运行时输出是明显不对的,如下:
2026-04-10 16:19:41 [INFO]  Core operator results run in simulator as follow:
core_name           duration_time(us)   running_time(us)    
core2.veccore1      12.2                11.31               
y_tri: tensor([[0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        ...,
        [0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.]], device='npu:0', dtype=torch.float16)
y_ref: tensor([[0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        ...,
        [0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.]], device='npu:0', dtype=torch.float16,
       grad_fn=<NativeLayerNormBackward0>)
Layer Normalization 128,128 torch.float16 PASSED!

因为输出的全是0,实际上应该是比较随机的数字才对。msprof op运行时输出就正常。

那问题就是:是什么原因导致这种差异呢?msprof op是上板运行,msprof op simulator是仿真,是不上板而是用CPU仿真NPU运行吧?那造成这个问题是不是仿真功能的问题导致的呢?

我要发帖子