@@ -445,7 +445,7 @@ def test_tensor_copy_gpsimd_rejects_psum_tiles(patched_scope, src_buffer, dst_bu
445445 del patched_scope
446446 src = _nd (np .arange (8 , dtype = np .float32 ).reshape (2 , 4 ), buffer = src_buffer )
447447 dst = b2 .NDArray (shape = src .shape , dtype = nl .float32 , buffer = dst_buffer )
448- with pytest .raises (ValueError , match = "GpSimd|gpsimd| PSUM|psum " ):
448+ with pytest .raises (ValueError , match = "GpSimd tensor_copy cannot access PSUM" ):
449449 nisa .tensor_copy (dst , src , engine = nisa .gpsimd_engine )
450450
451451
@@ -457,7 +457,10 @@ def test_tensor_copy_scalar_engine_requires_nc_v3_or_newer(patched_scope):
457457 try :
458458 src = _nd (np .arange (8 , dtype = np .float32 ).reshape (2 , 4 ), buffer = "sbuf" )
459459 dst = b2 .NDArray (shape = src .shape , dtype = nl .float32 , buffer = "sbuf" )
460- with pytest .raises (ValueError , match = "Scalar|scalar|v2|gen2" ):
460+ with pytest .raises (
461+ ValueError ,
462+ match = "Scalar Engine tensor_copy is unsupported on NeuronCore-v2" ,
463+ ):
461464 nisa .tensor_copy (dst , src , engine = nisa .scalar_engine )
462465 finally :
463466 b2 .nki_builder .nc_version = prev
@@ -548,16 +551,16 @@ def test_nc_matmul_requires_psum_dst_and_sbuf_inputs(patched_scope):
548551 stationary = _nd (np .arange (12 , dtype = float ).reshape (4 , 3 ), buffer = "sbuf" )
549552 moving = _nd (np .arange (8 , dtype = float ).reshape (4 , 2 ), buffer = "sbuf" )
550553 bad_dst = _zeros ((3 , 2 ), buffer = "sbuf" )
551- with pytest .raises (ValueError , match = "nc_matmul requires dst in psum " ):
554+ with pytest .raises (ValueError , match = "nc_matmul requires dst in PSUM " ):
552555 nisa .nc_matmul (bad_dst , stationary , moving )
553556
554557 dst = _zeros ((3 , 2 ), buffer = "psum" )
555558 bad_stationary = _nd (np .arange (12 , dtype = float ).reshape (4 , 3 ), buffer = "hbm" )
556- with pytest .raises (ValueError , match = "nc_matmul requires stationary in sbuf " ):
559+ with pytest .raises (ValueError , match = "nc_matmul requires stationary in SBUF " ):
557560 nisa .nc_matmul (dst , bad_stationary , moving )
558561
559562 bad_moving = _nd (np .arange (8 , dtype = float ).reshape (4 , 2 ), buffer = "hbm" )
560- with pytest .raises (ValueError , match = "nc_matmul requires moving in sbuf " ):
563+ with pytest .raises (ValueError , match = "nc_matmul requires moving in SBUF " ):
561564 nisa .nc_matmul (dst , stationary , bad_moving )
562565
563566
@@ -618,7 +621,7 @@ def test_nc_transpose_rejects_documented_engine_buffer_failures(
618621 del patched_scope
619622 src = _typed_ndarray ((4 , 3 ), "float32" , buffer = src_buffer )
620623 dst = b2 .NDArray (shape = (3 , 4 ), dtype = nl .float32 , buffer = dst_buffer )
621- with pytest .raises (ValueError , match = "buffer|engine|sbuf|psum|hbm " ):
624+ with pytest .raises (ValueError , match = "buffer|Engine|SBUF|PSUM|HBM " ):
622625 nisa .nc_transpose (dst , src , engine = engine )
623626
624627
@@ -813,7 +816,7 @@ def test_tensor_tensor_rejects_documented_gpsimd_psum_case(patched_scope):
813816 lhs = _typed_ndarray ((2 , 4 ), "float32" , buffer = "psum" )
814817 rhs = _typed_ndarray ((2 , 4 ), "float32" , buffer = "sbuf" , seed = 1 )
815818 dst = b2 .NDArray (shape = (2 , 4 ), dtype = nl .float32 , buffer = "sbuf" )
816- with pytest .raises (ValueError , match = "GpSimd|gpsimd| PSUM|psum " ):
819+ with pytest .raises (ValueError , match = "GpSimd|PSUM" ):
817820 nisa .tensor_tensor (dst , lhs , rhs , nl .power , engine = nisa .gpsimd_engine )
818821
819822
@@ -823,7 +826,7 @@ def test_tensor_tensor_rejects_documented_psum_power_dst(patched_scope):
823826 lhs = _typed_ndarray ((2 , 4 ), "float32" , buffer = "sbuf" )
824827 rhs = _typed_ndarray ((2 , 4 ), "float32" , buffer = "sbuf" , seed = 1 )
825828 dst = b2 .NDArray (shape = (2 , 4 ), dtype = nl .float32 , buffer = "psum" )
826- with pytest .raises (ValueError , match = "GpSimd|gpsimd| PSUM|psum |power" ):
829+ with pytest .raises (ValueError , match = "GpSimd|PSUM|power" ):
827830 nisa .tensor_tensor (dst , lhs , rhs , nl .power , engine = nisa .gpsimd_engine )
828831
829832
@@ -1009,7 +1012,9 @@ def test_tensor_scalar_rejects_documented_engine_failures(patched_scope, op0, en
10091012 del patched_scope
10101013 data = _typed_ndarray ((2 , 4 ), "float32" , buffer = "sbuf" )
10111014 dst = b2 .NDArray (shape = (2 , 4 ), dtype = nl .float32 , buffer = "sbuf" )
1012- with pytest .raises (ValueError , match = "vector|scalar|GpSimd|gpsimd|bitvec|rsqrt" ):
1015+ with pytest .raises (
1016+ ValueError , match = "Vector Engine|Scalar Engine|GpSimd|bitvec|rsqrt"
1017+ ):
10131018 nisa .tensor_scalar (
10141019 dst , data , getattr (nl , op0 ), 1.0 , engine = getattr (nisa , engine )
10151020 )
@@ -1463,7 +1468,7 @@ def test_dma_copy_buffer_dtype_rmw_matrix(patched_scope):
14631468 )
14641469 _assert_tensor_equal (dst .data , expected_rmw )
14651470
1466- with pytest .raises (ValueError , match = "dma_copy only supports hbm/sbuf " ):
1471+ with pytest .raises (ValueError , match = "dma_copy only supports HBM/SBUF " ):
14671472 nisa .dma_copy (
14681473 b2 .NDArray (shape = (4 , 4 ), dtype = _dtype_token ("float32" ), buffer = "sbuf" ),
14691474 b2 .NDArray (shape = (4 , 4 ), dtype = _dtype_token ("float32" ), buffer = "psum" ),
0 commit comments