From ca043473b03bb2d938d7a2dc22ff8bf63a64e3d0 Mon Sep 17 00:00:00 2001 From: lvyufeng Date: Sun, 22 Mar 2026 09:10:08 +0800 Subject: [PATCH 1/3] fix(npu): enable native aclnnLerps on 310B (verified OK on CANN 8.5) Remove lerp from 310B fallback list. aclnnLerps was previously marked as returning 561103 but is now confirmed working on this runner. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- src/candle/_backends/npu/ops_soc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/candle/_backends/npu/ops_soc.py b/src/candle/_backends/npu/ops_soc.py index 3d6a272c..2c7db54e 100644 --- a/src/candle/_backends/npu/ops_soc.py +++ b/src/candle/_backends/npu/ops_soc.py @@ -54,7 +54,6 @@ "remainder", # aclnnRemainderTensorTensor returns 161002; composite uses where "where", # aclnnSWhere returns 561000 on 310B "atan2", # aclnnAtan2 returns 561103 - "lerp", # aclnnLerps returns 561103 "dropout", # aclnnDropoutDoMask returns 561103 "softplus", # aclnnSoftplus returns 561103; mish composite depends on this "isclose", # aclnnIsClose returns 561103 on 310B From 76ac5a2e9c4598dc7359494aaaac3fa57b9c354e Mon Sep 17 00:00:00 2001 From: lvyufeng Date: Sun, 22 Mar 2026 09:48:57 +0800 Subject: [PATCH 2/3] fix(ci): repair numpy after 310B segfault before common tests Segfaults from the 310B test suite can corrupt numpy .so files on the persistent runner. Add a reinstall step before common tests to ensure importability. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/npu-310b.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/npu-310b.yaml b/.github/workflows/npu-310b.yaml index 19f5953d..0b237654 100644 --- a/.github/workflows/npu-310b.yaml +++ b/.github/workflows/npu-310b.yaml @@ -127,6 +127,11 @@ jobs: pkill -9 -f 'pytest|python.*candle' || true sleep 2 sync && echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null || true + - name: Repair numpy after 310B segfault + run: | + # Segfaults from the 310B test suite can corrupt numpy .so files on the + # persistent runner. Reinstall to ensure common tests can import numpy. + "$JOB_CONDA_ENV/bin/python" -m pip install --force-reinstall numpy --quiet - name: Run NPU common tests run: | source "$ASCEND_ENV_SCRIPT" From ae2f92e8befa10719774e1fb428269e59d868fe1 Mon Sep 17 00:00:00 2001 From: lvyufeng Date: Sun, 22 Mar 2026 10:29:29 +0800 Subject: [PATCH 3/3] revert(npu): restore lerp to 310B fallback list aclnnLerps returns 561103 on CI runner (orangepiaipro-20t). Local probe showed OK but CI runner differs. Co-Authored-By: Claude Sonnet 4.6 --- src/candle/_backends/npu/ops_soc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/candle/_backends/npu/ops_soc.py b/src/candle/_backends/npu/ops_soc.py index 2c7db54e..3d6a272c 100644 --- a/src/candle/_backends/npu/ops_soc.py +++ b/src/candle/_backends/npu/ops_soc.py @@ -54,6 +54,7 @@ "remainder", # aclnnRemainderTensorTensor returns 161002; composite uses where "where", # aclnnSWhere returns 561000 on 310B "atan2", # aclnnAtan2 returns 561103 + "lerp", # aclnnLerps returns 561103 "dropout", # aclnnDropoutDoMask returns 561103 "softplus", # aclnnSoftplus returns 561103; mish composite depends on this "isclose", # aclnnIsClose returns 561103 on 310B