Skip to content

[bug] interpolate doesn't work with small scale_factor values #150

Description

@vladgor

torch.nn.functional.interpolate doesn't work with small scale_factor values.

Atlas 800I A2 with Ascend 910B4 chips.
Ubuntu 22.04.5 LTS
python 3.11.15
CANN 9.0.0
torch==2.9.0
torch-npu==2.9.0.post2

Traceback
Traceback (most recent call last):
  File "/cache/goryunov/CosyVoice/minimal_example.py", line 29, in <module>
    main()
  File "/cache/goryunov/CosyVoice/minimal_example.py", line 17, in main
    t = torch.rand(b, c, s, dtype=DTYPE, device='npu:0')
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: operator():../third_party/op-plugin/op_plugin/ops/opapi/UniformKernelNpuOpApi.cpp:34 NPU function error: call aclnnInplaceUniform failed, error code is 507015
[ERROR] 2026-07-01-22:07:57 (PID:188344, Device:0, RankID:-1) ERR00100 PTA call acl api failed
[Error]: The aicore execution is abnormal.
        Rectify the fault based on the error information in the ascend log.
[PID: 188344] 2026-07-01-22:07:57.515.266 AclNN_Runtime_Error(EZ9903): aclrtMemcpyAsync workspace input failed: 507015
        Solution: In this scenario, collect the plog when the fault occurs and locate the fault based on the plog.
        TraceBack (most recent call last):
        rtMemcpyAsync execution failed, reason=aicore exception[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:65]
        [Call][Rts]call rts api [rtMemcpyAsync] failed, retCode is 507015[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:148]
        aclrtMemcpyAsync workspace input failed: 507015
        ParamMemCpy failed
        DSA task distribute error.
        launch failed for DSARandomUniform, errno:561000.
                                                                                                                                                                                                                 [W701 22:07:57.913408365 NPUStream.cpp:596] Warning: NPU warning, error code is 507015[Error]:
[Error]: The aicore execution is abnormal.
        Rectify the fault based on the error information in the ascend log.
EE9999: Inner Error!
EE9999[PID: 188344] 2026-07-01-22:07:57.516.792 (EE9999):  rtDeviceSynchronizeWithTimeout execution failed, reason=aicore exception[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:65]
        TraceBack (most recent call last):
       wait for compute device to finish failed, runtime result = 507015.[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:148]
 (function npuSynchronizeUsedDevices)
[W701 22:07:57.914418890 NPUStream.cpp:578] Warning: NPU warning, error code is 507015[Error]:
[Error]: The aicore execution is abnormal.
        Rectify the fault based on the error information in the ascend log.
EE9999: Inner Error!
EE9999[PID: 188344] 2026-07-01-22:07:57.517.829 (EE9999):  rtDeviceSynchronizeWithTimeout execution failed, reason=aicore exception[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:65]
        TraceBack (most recent call last):
       wait for compute device to finish failed, runtime result = 507015.[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:148]
 (function npuSynchronizeDevice)
Minimal reproducible example
import torch
import torch_npu

batches = [1, 2]
channels = [1, 3, 9]
size = [480*10, 237120]
scale_factors = [1/2, 1/15, 1/30, 1/60, 1/120, 1/240, 1/480]
SCALE_FACTOR = 1/480
DTYPE = torch.float32

def main():
    for sf in scale_factors:
        for b in batches:
            for c in channels:
                for s in size:                
                    t = torch.rand(b, c, s, dtype=DTYPE, device='npu:0')
                    status = True
                    try:
                        ret = torch.nn.functional.interpolate(t, scale_factor=sf, mode='linear')
                        ret = ret.sum()
                    except Exception:
                        status = False
                    print(b, c, s, sf, status)


if __name__ == '__main__':
    main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions